local skel = fk.CreateSkill {
  name = "emo__aini",
  tags = {Skill.Compulsory}
}

Fk:loadTranslationTable{
  ["emo__aini"] = "爱你",
  [":emo__aini"] = "锁定技，你不因“爱你”使用牌指定你一名发动过“结芬”的角色为目标后，你与其各摸一张牌，然后你观看其手牌并使用其中的一张。",

  ["#emo__aini-use"] = "爱你：可以使用其一张牌哦",

  ["$emo__aini1"] = "这是爱的一击哦！",
}

skel:addEffect(fk.TargetSpecified, {
  anim_type = "drawcard",
  can_trigger = function (self, event, target, player, data)
    if player:hasSkill(skel.name) and target == player and data.to then
      local to = data.to
      return not to.dead and table.contains(player:getTableMark("emo__jiefen_tar"), to.id)
      and not (data.use and (data.use.extra_data or Util.DummyTable).emo__aini_use )
    end
  end,
  on_cost = function (self, event, target, player, data)
    event:setCostData(self, {tos = {data.to}})
    return true
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
    player:drawCards(1, skel.name)
    local to = data.to
    if to.dead then return end
    to:drawCards(1, skel.name)
    if to.dead or  to:isKongcheng() or player.dead then return end
    local hand = to:getCardIds("h")
    local use = room:askToUseRealCard(player, {
      pattern = hand, expand_pile = hand, skill_name = skel.name, prompt = "#emo__aini-use", skip = true,
    })
    if use then
      use.extra_data = use.extra_data or {}
      use.extra_data.emo__aini_use = true
      room:useCard(use)
    end
  end,
})

return skel
